#ifndef __SNAKE_H__
#define __SNAKE_H__

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<time.h>
#include<conio.h>
#include<windows.h>

#define HIGHT 20
#define WIDTH 60
#define MAX_SCORES 10


typedef struct 
{
    int x;
    int y;
}Position;

//蛇定义
typedef struct
{
    Position head;
    Position body[HIGHT*WIDTH];
    int size;
}Snake;

Position Food;//食物定义
Snake snake;//蛇定义

void initsnake();
void initfood();
void putsnake();
void playgame();
void putwall();
void loadScores();
void saveScores();
void showLeaderboard();
void addToLeaderboard();
int kx=0,ky=0;
int score=0;
int lastX,lastY;
int sleepsecond=400;
COORD coord;
int isPaused=0;
int scores[MAX_SCORES];

#endif